<!DOCTYPE html>
<html>
<head>
    <title>计划维护记录详情</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <i-form ref="formValidate" :label-width="80" style="text-align: center">
        <Row>
            <i-col span="6">
                <Form-item label="计划名称">
                    <span>
                        {{moduleMaintainPlan.planName}}
                    </span>
                </Form-item>
            </i-col>
            <i-col span="6">
                <Form-item label="模具编码">
                    <span>
                        {{moduleMaintainPlan.moduleCode}}
                    </span>
                </Form-item>
            </i-col>

        </Row>
        <Row>
            <i-col span="6">
                <Form-item label="计划状态">
                    <span>
                        {{status}}
                    </span>
                </Form-item>
            </i-col>
            <i-col span="6">
                <Form-item label="执行时间">
                    <span>
                        {{transDate(moduleMaintainPlan.actionDate, "yyyy-MM-dd hh:mm:ss")}}
                    </span>
                </Form-item>
            </i-col>
        </Row>
    </i-form>
    <Card>
        <Tabs value="record0" type="card">
            <Tab-pane label="维护记录选项" name="record0">
                <table id="plan_record"></table>
            </Tab-pane>
        </Tabs>
    </Card>
</div>

</body>
<script>
    var planId = getQueryString("planId");
    var vm = new Vue({
        el: '#rrapp',
        data: {
            moduleMaintainPlan: {},
            status:''
        },
        method:{
        }
    });
    $(function () {
        getInfo(planId);
        //查询计划数据
        loadData();
    });

    function loadData(){
        //获取计划内容
        $("#plan_record").Grid({
            url: '../modulemaintainrelate/list?planID='+ planId,
            rownumWidth: 35,
            multiselect: false,
            rownumbers: false,
            colModel: [
                {label: '序号', name: 'moduleMaintainOption.orNum', width: 40},
                {label: '一级名称', name: 'moduleMaintainOption.optionSubclass', width: 60},
                {label: '二级名称', name: 'moduleMaintainOption.optionName', width: 80},
                {label: '方法手段', name: 'moduleMaintainOption.method'},
                {label: '检查标准', name: 'moduleMaintainOption.inspectStandard', width: 80},
                {label: '选项备注', name: 'moduleMaintainOption.optionRemark', width: 80},
                {label: '维护前', name: 'bmCheckResult', width: 40,
                    formatter: function (value) {
                        if(value=="null" || value==null){
                            return "暂无结果";
                        }else{
                            return sysEnums.MODULE_READY_STATUS[value];
                        }
                    }
                },
                {label: '维护后', name: 'amConfirmResult', width: 40,
                    formatter: function (value) {
                        if(value=="null" || value==null){
                            return "暂无结果";
                        }else{
                            return sysEnums.MODULE_READY_STATUS[value];
                        }
                    }
                },
                {label: '备注信息', name: 'remark', width: 80},
                {label: 'id', name: 'id', key: true, hidden: true},
            ]
        });
    }

    function getInfo(planId){
        Ajax.request({
            url: "../modulemaintainplan/info/" + planId,
            async: true,
            successCallback: function (r) {
                vm.moduleMaintainPlan = r.moduleMaintainPlan;
                vm.status = sysEnums.MOLD_MAINTENANCE_PLAN_PROGRESS[vm.moduleMaintainPlan.progress];
            }
        });
    }

</script>
</html>
